<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
      <#include "/common/elibs.html">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
  </head>
  <script>var index;
  </script><body>
    <div class="x-body">
        <form class="layui-form">
            <input type="hidden" name="idProAdmin" id="idProAdmin" value="${id}"/>
            <div class="layui-form-item">
                <label for="customerEvaluation" class="layui-form-label">
                    <span class="x-red">*</span>客户满意度评价表：<br/>
                    <div style="color: #797474;margin-top: 9px;">注：涵盖格式有（word，pdf，jpg）</div>
                </label>
                <div class="layui-input-inline">
                    <img class="layui-upload-img" src="" id="imgUrl" width="100px" /><br><br><br>
                    <input type="hidden" id="customerEvaluation" name="customerEvaluation"  >
                    <button type="button" class="layui-btn" id="upload">
                        <i class="layui-icon">&#xe67c;</i>上传文件
                    </button><script>
                    updateFile("upload","imgUrl","customerEvaluation");
                </script>
                </div>
            </div>

            <div class="layui-form-item">
                <label for="customerEvaluation" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="preservation" type=button codeTyle="1" lay-submit="">
                    保存
                </button>
                <button  class="layui-btn" lay-filter="preAdd" type=button codeTyle="2" lay-submit="">
                    预提交
                </button>
                <button  class="layui-btn" lay-filter="add" type=button codeTyle="3" lay-submit="">
                    提交
                </button>
            </div>
      </form>
    </div>
    <script>

        layui.use(['form','layer'], function() {
            $ = layui.jquery;
            var form = layui.form
                , layer = layui.layer, layedit = layui.layedit;

            //自定义验证规则
            form.verify({});

            //监听提交
            form.on('submit(add)', function (t) {
                addSubmit(3);
            });

            //监听保存
            form.on('submit(preservation)', function (t) {
                addSubmit(1);
            });

            //监听预提交
            form.on('submit(preAdd)', function (t) {
                addSubmit(2);
            });
        });

        function addSubmit(submitState){
            var params = {
                //tcaDescribe : layui.layedit.getContent(index),
                "idProAdmin": $("#idProAdmin").val(),
                "customerEvaluation": $("#customerEvaluation").val(),
                "submitState":submitState
            }
            console.log(params);
            if (true) {
                ajaxFun('post','/pc/project/addUserEvaluation',params,function(data){
                    if (data.code != 0) {
                        alertFun(data);
                    } else {
                        window.location.href = path + "/modules/project/yhpjgz/list.html";
                        console.log("success !");
                    }                })
                return false;
            }
        }
    </script></body></html>